<?php
class Lin_Dialog
{
	static function msg($title, $msg,  $id)
	{
		if ($id === -1)
		{
			$jsAction = 'history.go(-1);';
		}
		else
		{
			$jsAction = 'location.replace("' . $id . '");';
		}
		
		$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Dialog</title>
		<link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" />
		' .  Lin_Grid::includeSource() . '
		<script>
		$(function() {
			$( "#dialog-message" ).dialog({
				modal: true,
				buttons: {
						Ok: function() {
							$( this ).dialog( "close" );
						}
					},
				close: function() {　' . $jsAction . '　}
			});
		});
		</script>
		</head>
		
		<body>
		<div id="dialog-message" title="' . $title . '">
			<p>
				<span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
				' . $msg . '
			</p>
		</div>
		</body>
		</html>';
		echo ($html);
		exit;
	}
}